function bofang(ldr,lds){document.getElementById('audioBox').innerHTML = '';var str=document.getElementById("ykloadshu").innerHTML;
str=str.replace(/<[^>]+>/g,"");
str= str.replace(/&NBSP;/g, " ");
str= str.replace(/&nbsp;/g, " ");
str = str.replace(/[;\s]+/mg, "");
str=str.replace(/@/g, "");str=str.replace(/%/g, "");
str=str.replace(/\"/g, "");str=str.replace(/[\r\n]/g, "");
var jst="var arr = [";	var hidd="";
for(var i=0,len=str.length/200;i<len;i++) {
str1 = str.substr(-200);
if(i==0){jst=jst+'"http://tts.baidu.com/text2audio?idx=1&tex='+str1+'&cuid=baidu_speech_demo&cod=2&lan=zh&ctp=1&pdt=1&spd='+encodeURI(lds)+'&per='+encodeURI(ldr)+'&vol=5&pit=5"';
str = str.replace(str1,'');}
else{jst=jst+',"http://tts.baidu.com/text2audio?idx=1&tex='+str1+'&cuid=baidu_speech_demo&cod=2&lan=zh&ctp=1&pdt=1&spd='+encodeURI(lds)+'&per='+encodeURI(ldr)+'&vol=5&pit=5"';
str = str.replace(str1,'');}
}
 jst=jst+'];';
 eval(jst);
        var myAudio = new Audio();
        myAudio.preload = true;
        myAudio.controls = true;
        myAudio.src = arr.pop();//每次读数组最后一个元素
        myAudio.addEventListener('ended', playEndedHandler, false);
        myAudio.play();
        document.getElementById("audioBox").appendChild(myAudio);
        myAudio.loop = false;//禁止循环，否则无法触发ended事件
        function playEndedHandler(){
            myAudio.src = arr.pop();
            myAudio.play();
            console.log(arr.length);
            !arr.length && myAudio.removeEventListener('ended',playEndedHandler,false);//只有一个元素时解除绑定
        }
    }
    

